package 历年真题;

import java.util.Scanner;

public class q23 {

    /**
     * 将字符串转换后输出
     *
     * @param str
     * @return
     */
    private static char[] reverseToReverse(String str) {
        return new StringBuffer(str).reverse().toString().toCharArray();
    }

    private static boolean check(char[] ch) {
        int jiShuSum = 0;
        int ouShuSum = 0;

        for (int i = 1; i <= ch.length; i++) {
            int current = Integer.parseInt(ch[i - 1] + "");
            if (i % 2 == 1) {
                jiShuSum += current;
            } else {
                if (current * 2 > 9) {
                    ouShuSum += current * 2 - 9;
                } else {
                    ouShuSum += current * 2;
                }
            }
        }

        return (jiShuSum + ouShuSum) % 10 == 0 ? true : false;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        if (check(reverseToReverse(scanner.nextLine()))) {
            System.out.println("成功");
        } else {
            System.out.println("失败");
        }
    }
}
